package com.hmall.user.service.impl;

import com.hmall.user.mapper.userMapper;
import com.hmall.user.pojo.Address;
import com.hmall.user.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class userServiceImpl implements userService {

    @Autowired(required = false)
    private userMapper userMapper;
    /**
     * 处理根据用户id查询地址列表
     *
     * @param userId
     * @return
     */
    @Override
    public List<Address> byAddresses(int userId) {
        return userMapper.selectByAddresses(userId);
    }

    /**
     * 处理根据addressId查询Address
     *
     * @param addressId
     * @return
     */
    @Override
    public Address byAddressesId(int addressId) {
        return userMapper.selectByAddressesId(addressId);
    }
}
